function pageinfo(pages, nowpage, id, name) {
    var fun = "";
    if(id != undefined && id!= null && id != '' && name != undefined && name != null && name != '')
        fun = "," + id + ",'" + name + "'";
    var infoStr = "";
    if(pages > 1) {
        if(nowpage == 1) {
            infoStr += '<span onclick="javascript:void(0);">&lt;</span>';
        } else {
            infoStr += '<span onclick="topage('+(nowpage * 1 - 1) + fun +');">&lt;</span>';
        }

        if(pages <= 5 || nowpage <= 3) {
            var count = pages <= 5 ? pages : 5;
            for (var i = 1; i <= count; i ++) {
                infoStr += '<span onclick="topage('+ i + fun +');">'+i+'</span>';
            }
        } else {
            if(nowpage < pages - 4) {
                for (var i = nowpage - 2; i <= nowpage + 2; i ++) {
                    infoStr += '<span onclick="topage('+ i + fun +');">'+i+'</span>';
                }
            } else {
                for (var i = pages - 4; i <= pages; i ++) {
                    infoStr += '<span onclick="topage('+ i + fun +');">'+i+'</span>';
                }
            }
        }

        if(nowpage == pages) {
            infoStr += '<span onclick="javascript:void(0);">&gt;</span>';
        } else {
            infoStr += '<span onclick="topage('+(nowpage * 1 + 1) + fun +');">&gt;</span>';
        }
    }
    return infoStr;
}